package commonObj;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegularExpression {
    public static void main(String[] args) {
        //判断一个18号段的手机号
        Pattern pattern = Pattern.compile("18[35679]\\d{8}");
        Matcher m1 = pattern.matcher("18512345678");
        Matcher m2 = pattern.matcher("1851234567");
        Matcher m3 = pattern.matcher("18112345678");
        System.out.println(m1.matches());
        System.out.println(m2.matches());
        System.out.println(m3.matches());
    }
}
